package com.xgh;

import java.util.Hashtable;

/**
 * @ClassName Demo
 * @Description
 * @Author xinggh
 * @Date 2020/6/12 11:24
 * @Version 1.0
 **/
public class Demo {

    static double EPSINON = 0.0000000001;

    public static void main(String[] args) {

   /*     Demo demo = new Demo();
        Class<Demo> demoClass = Demo.class;
        demoClass.getDeclaredMethods();
        Class<? extends Demo> aClass = demo.getClass();
        for (int i = 0; i < 10; i++) {
            System.out.println("hello World");
        }*/
        System.out.println(sqrt2());

        Hashtable hashtable = new Hashtable();
        hashtable.put(null,2);

    }

    static double sqrt2() {
        double low = 1.4, high = 1.5;
        double mid = (low + high) / 2;
        while ((high - low) > EPSINON) {
            if (mid * mid < 2) {
                high = mid;
            } else {
                low = mid;
            }
            mid = (high + low) / 2;
        }
        return mid;
    }
}
